package chixing.day18.work;

public class windows extends Thread{
    public windows() {
    }
    public void run() {
        while(true) {
            synchronized (TicketSeller.class) {
                if(TicketSeller.tickets <= 0) {
                    break;
                }
                System.out.println("窗口" + Thread.currentThread().getName() + "售出一张票，剩余" + (--TicketSeller.tickets) + "张票");
            }
        }
    }


}
